//
//  HROrderApplyFooter.h
//  haierapp
//
//  Created by gaotangzhang on 14-8-19.
//  Copyright (c) 2014年 haier. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "HROrderType.h"

#define HEIGHT_FOOTER_ORDERCELL_ALL_SHOW 90.0f
#define HEIGHT_FOOTER_ORDERCELL_SHOW_SEPERATE 50.0f
#define HEIGHT_FOOTER_ORDERCELL_SHOW_BUTTON 80.0f
#define HEIGHT_FOOTER_ORDERCELL_NORMAL 40.0f


@protocol OrderFooterButtonActionDelegate <NSObject>

//申请退换货
-(void)returnsOrderProduct:(HROrder *)order;

//评价商品
-(void)commentOrderProduct:(HROrder *)order;

//再次购买
-(void)buyAgainOrderProduct:(HROrder *)order;

//查看进度
-(void)viewOrderProgressByOrderId:(NSString *)orderId;

//确认收货
-(void)receiveProductsByOrderId:(NSString *)orderId;

//取消订单
-(void)cancelOrderByOrderId:(NSString *)orderId;

//付款
-(void)paymentOrderByOrderId:(NSInteger)section;

@end

@interface HROrderApplyFooter : UIView


@property(nonatomic,weak) id<OrderFooterButtonActionDelegate> delegate;
@property(nonatomic,strong) NSString *orderNo;
@property(nonatomic,strong) HROrder *order;
@property(nonatomic,assign) NSInteger section; 


@property (weak, nonatomic) IBOutlet UILabel *goodsCountLabel;
@property (weak, nonatomic) IBOutlet UILabel *goodsTotalPriceLabel;
@property (weak, nonatomic) IBOutlet UIView *bottomLine;
@property (weak, nonatomic) IBOutlet UIView *seperateView;
@property (weak, nonatomic) IBOutlet UIView *topLine;

@property (weak, nonatomic) IBOutlet UIView *buttonView;

@property (weak, nonatomic) IBOutlet UILabel *priceTitleLabel;

/////////// Button Outlet

@property (weak, nonatomic) IBOutlet UIButton *returnButton;
@property (weak, nonatomic) IBOutlet UIButton *commentButton;
@property (weak, nonatomic) IBOutlet UIButton *buyAgainButton;
@property (weak, nonatomic) IBOutlet UIButton *progressButton;
@property (weak, nonatomic) IBOutlet UIButton *receiveButton;
@property (weak, nonatomic) IBOutlet UIButton *cancelButton;
@property (weak, nonatomic) IBOutlet UIButton *payButton;


//////////

////////// Button Contraint Outlet
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *payWidthCons;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *cancelWidthCons;


@property (weak, nonatomic) IBOutlet NSLayoutConstraint *receiveWidthCons;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *progressWidthCons;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *commentWidthCons;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *buyAgainWidthCons;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *returnPaddingRight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *commentPaddingRight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *buyAgainPaddingRight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *progressPaddingRight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *receivePaddingRight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *cancelPaddingRight;


@property (weak, nonatomic) IBOutlet NSLayoutConstraint *buttonViewHeight;



-(id)initWithShowBottomLine:(BOOL)showLine AndShowSeperateView:(BOOL)showSeperate;

-(id)initWithShowBottomLine:(BOOL)showLine AndShowSeperateView:(BOOL)showSeperate andShowButtonByType:(ORDER_TYPE)orderType;

-(void)showButtonsByOrderType:(ORDER_TYPE)orderType;

@end
